package com.darsystems.foghourz.client;

import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.widgetideas.graphics.client.Color;
import com.google.gwt.widgetideas.graphics.client.GWTCanvas;

public class DailySparkLine {
	
	public static Widget create(double percent, double target)
	{
		final int width = 100;
		GWTCanvas canvas = new GWTCanvas(width,20);
	    
	    //canvas.setLineWidth(1);
		canvas.setFillStyle(percent >= target ? Color.GREEN : Color.ORANGE);
		canvas.fillRect(1, 3, width * percent, 14);
	    //canvas.setStrokeStyle(Color.GREEN);
	    
	    return canvas;
	}

}
